#pragma once
#ifndef __G_BOX_ALIGNED_H__
#define __G_BOX_ALIGNED_H__

#include "GPlane.h"
#include "GVector3.h"
#include "GBoxOriented.h"

#include "GUtilities/GTypes.h"

namespace GMath
{

	class GBoxAligned
	{
	public:
		const static GBoxAligned	UnitBox;

		GVector3			Min;
		GVector3			Max;

							GBoxAligned();
							GBoxAligned(const GVector3& TheMin, const GVector3& TheMax);
							GBoxAligned(const GVector3& Center, float Width, float Height, float Depth);

		void				Create(const GVector3& TheMin, const GVector3& TheMax);
		void				Create(const GVector3& Center, float Width, float Height, float Depth);

		void				GetNormal(OUTPUT GVector3& OutNormal, const GVector3& SurfacePoint) const;

		float				Volume() const;
		float				SurfaceArea() const;

		GVector3			GetCenter() const;
		GVector3			GetDimension() const;

		void				GetPlanes(OUTPUT GPlane PlaneArray[G_BP_COUNT]) const;
		void				GetCorners(OUTPUT GVector3 Arr[G_BC_COUNT]) const;
		GVector3			GetCorner(GBoxCorner Corner) const;

		const GVector3		GetRight() const;
		const GVector3		GetUp() const;
		const GVector3		GetFront() const;

		void				Combine(const GBoxAligned& Box);
		static void			Combine(OUTPUT GBoxAligned& OutBox, const GBoxAligned& Box1, const GBoxAligned& Box2);

		static void			Convert(OUTPUT GBoxOriented& OutBox, const GBoxAligned& Box);
		static void			Convert(OUTPUT GBoxAligned& OutBox, const GBoxOriented& Box);

		const GBoxAligned&	operator = (const GBoxAligned& Box);
	
	};

}

#endif